//package com.travel.travelServer.service1.impl;
//
//import com.travel.travelServer.entity1.vo.CommentVo;
//import com.travel.travelServer.entity1.vo.LandscapesVo;
//import com.travel.travelServer.entity1.vo.UserVo;
//import com.travel.travelServer.mapper1.CommentMapper;
//import com.travel.travelServer.mapper1.LandscapesMapper;
//import com.travel.travelServer.mapper1.ThailMapper;
//import com.travel.travelServer.mapper1.UserMapper;
//import com.travel.travelServer.service1.DashboardService;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Service;
//
//import java.util.ArrayList;
//import java.util.HashMap;
//import java.util.List;
//import java.util.Map;
//
//@Service
//public class DashboardServiceImpl implements DashboardService {
//
//    @Autowired
//    private UserMapper userMapper;
//
//    @Autowired
//    private LandscapesMapper landscapesMapper;
//
//    @Autowired
//    private ThailMapper thailMapper;
//
//    @Autowired
//    private CommentMapper commentMapper;
//
//    @Override
//    public Map<String, Object> getDashboardInfo() {
//        Map<String, Object> map = new HashMap<>();
//        map.put("userNum", userMapper.selectList(null).size());
//        map.put("landscapesNum", landscapesMapper.selectList(null).size());
//        map.put("thailNum", thailMapper.selectList(null).size());
//        map.put("commentNum", commentMapper.selectList(null).size());
//        List<UserVo> userVos = userMapper.selectNumByDate();
//        map.put("userGrowthData", userVos);
//        List<LandscapesVo> landscapesVos = landscapesMapper.selectNumByDate();
//        List<Map<String, Object>> maps = new ArrayList<>();
//        for (LandscapesVo landscapesVo : landscapesVos) {
//            Map<String, Object> hashMap = new HashMap<>();
//            hashMap.put("value", landscapesVo.getLandscapesCount());
//            hashMap.put("name", landscapesVo.getPlace());
//            maps.add(hashMap);
//        }
//        map.put("landscapesDistributionData", maps);
//        List<CommentVo> commentVos = commentMapper.selectNumByDate();
//        List<Map<String, Object>> map2s = new ArrayList<>();
//        for (CommentVo commentVo : commentVos) {
//            Map<String, Object> hashMap = new HashMap<>();
//            hashMap.put("value", commentVo.getCommentCount());
//            hashMap.put("name", commentVo.getCreateTime());
//            map2s.add(hashMap);
//        }
//        map.put("salesData", map2s);
//        return map;
//    }
//}
